package org.wattdepot.cli.command;

import static org.junit.Assert.assertEquals;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test;
import org.wattdepot.cli.CommandLineInterface;

/**
 * Test that checks for valid output from sensordatatimestamp class.
 * 
 * @author Anthony Xu & John Mack
 * 
 */
public class TestSensordataTimestamp {

  /**
   * Test to see if the sensordatatimestamp displays correct output.
   * @throws Exception NotAuthorizedException, ResourceNotFoundException, 
   *                   BadXmlException, MiscClientException.
   */
  @Test
  public void testListSummary() throws Exception {
    CommandLineInterface cli = new CommandLineInterface();
    List<String> commands = new ArrayList<String>();
    commands.add("sensordata");
    commands.add("SIM_KAHE_2");
    commands.add("timestamp");
    commands.add("2009-10-31T23:45:00.000-10:00");

    String sensordataTime = new ListSensordataTimestamp().doCommand(cli, commands);
    assertEquals("correct output", "Timestamp: 2009-10-31T23:45:00.000-10:00" + "\n"
        + "Tool: OscarDataConverter" + "\n"
        + "Properties: [Property [key=powerGenerated, value=5.7E7]]" + "\n", sensordataTime);

  }

}
